We can get the playlists of the user by the following code block:
var request = MusicLibraryRequest<Playlist>()
request.sort(by: \.lastPlayedDate, ascending: false)
let response = try await request.response()
Also, we can add a track to the playlist with the following code block:
TASK {
do {
try await MusicLibrary.shared.add(track, to: playlist)
} catch (let error) {
print(error)
}
}
However not all playlists are editable. For instance if the playlist created by Apple or another Apple Music user, we receive an error while adding track to the playlist because we don't have a permission to do it.
How can I only retrieve playlists that are editable? Or in other words how can I retrieve playlists that are only created by the user?
Post
Replies
Boosts
Views
Activity
I imported the MediaPlayer framework and used MPMusicPlayerPlayParameters in my SwiftUI project.
While the app is launching, If the app is built by Xcode 14.3.1 or a newer version, it instantly crashes on a simulator or on a real device.
This problem persists on iOS 16.0 to 16.4. (I haven't tried iOS 15 or below) I also tried to build and run the app with Xcode 15 - beta 4 however it still crashes.
Because of this reason, I archive and submit to App Store with Xcode 14.2.
(the built made by Xcode 14.2 works perfectly!!)
Here is the error message:
dyld[17235]: Symbol not found: _$sSo27MPMusicPlayerPlayParametersCSe05MediaB0Mc
Referenced from:
<77FEF170-9C51-3580-8F8B-2ADD2F1B3FD1> /Users/[UserName]/Library/Developer/CoreSimulator/Devices/72CE26D8-4DD4-4319-B0C7-DE52D6645875/data/Containers/Bundle/Application/C808623F-5372-40F0-907F-E86E12AE6EDD/[AppName].app/[AppName]
Expected in:
<06F636E1-695C-34F1-809D-7CA24F67AFE9> /Library/Developer/CoreSimulator/Volumes/iOS_20B72/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 16.1.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer
I believe this is Apple related issue however if there is any way that can fix the issue, please let me know.